package jwt

import (
	"github.com/gin-gonic/gin"
	"github.com/golang-jwt/jwt/v5"
)

type Handler interface {
	SetLoginToken(ctx *gin.Context, id int64) error
	SetJWTToken(ctx *gin.Context, id int64, ssid string) error
	// CleanToken logout时清除redis
	CleanToken(ctx *gin.Context) error
	CheckSession(ctx *gin.Context, ssid string) (bool, error)
	ExtractToken(ctx *gin.Context) string
}

// JWT
type UserClaims struct {
	Id   int64 //用户ID
	Ssid string
	jwt.RegisteredClaims
}

type RefreshClaims struct {
	Id   int64 //用户ID
	Ssid string
	jwt.RegisteredClaims
}
